import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh'
const path = require('path')
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [reactRefresh()],
  // 开发环境代理服务器设置
  server: {
    proxy: {
      '/api': {
        target: 'https:xxxx/com',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''),
      },
    },
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
    },
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: '@import "./src/styles/settings/var.scss"; ',
      },
    },
  },
})
